//时间戳转中文时间
function transChineseDate(ts){
  var D,y,M,d,h,m,s,time;
  if(ts < 1000000000000) ts *= 1000;
  function format(n){
    if(n <10){
      return "0" + n;
    }
    return n;
  }

  D = new Date(ts);
  y = D.getFullYear() + "年";
  M = D.getMonth()  + 1 + "月";
  d = D.getDate() + "日 ";
  h = format(D.getHours()) + ":";
  m = format(D.getMinutes()) +":";
  s = format(D.getSeconds());
  time = y + M + d + h + m + s;
  return time;
}

export default {
  transChineseDate
}
